package com.lemon.cloud.command;

import com.lemon.cloud.command.annotation.Command;
import com.lemon.cloud.extension.ExtensionPointExecutor;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @author lemon
 * @version 1.0
 * @description: TODO
 * @date Create by lemon on 2019-09-15 11:36
 */
@Command
public class CustomCommandExecutor implements CommandExecutor<CustomResponse, CustomCommand> {
    @Autowired
    private ExtensionPointExecutor extensionPointExecutor;

    @Override
    public CustomResponse execute(CustomCommand command) {
        // validation
        this.extensionPointExecutor.executeVoid(CustomExtensionPoint.class, command.getBusinessScenario(), executeExtensionPoint -> executeExtensionPoint.customExtensionPoint(command));

        // Convert CO to Entity

        // Call Domain Entity for business logic processing
        return null;
    }
}
